package com.app.service.maintain;

import com.app.dao.maintain.MaintainMapper;
import com.app.entity.AppInfo;
import com.app.entity.AppVersion;
import com.app.entity.DataDictionary;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MaintainServiceImpl implements MaintainService{
    @Autowired
    private MaintainMapper main;

    @Override
    public List<AppInfo> show_all(String querySoftwarename,
                                  Integer queryStatus,
                                  Integer queryCategoryLevel1,
                                  Integer queryCategoryLevel2,
                                  Integer queryCategoryLevel3,
                                  Integer queryPlatFormId,
                                  Integer currentPageNo, Integer pageSize) throws Exception {
        List<AppInfo> info=null;
        currentPageNo=(currentPageNo-1)*pageSize;
        info = main.show_all(querySoftwarename,queryStatus,queryCategoryLevel1,queryCategoryLevel2,
                queryCategoryLevel3,queryPlatFormId,currentPageNo,pageSize);
        for (AppInfo i:
             info) {
            System.out.println("++++++++++++++++++++++++++++++++++++++++"+i.getAPKName());
        }
        return info;
    }

    @Override
    public int count(String querySoftwarename,
                     Integer queryStatus,
                     Integer queryCategoryLevel1,
                     Integer queryCategoryLevel2,
                     Integer queryCategoryLevel3,
                     Integer queryPlatFormId) {
        return main.count(querySoftwarename,queryStatus,queryCategoryLevel1,
                queryCategoryLevel2,queryCategoryLevel3,queryPlatFormId);
    }

    @Override
    public List<DataDictionary> show_type(String typeCode) {
        return main.show_type(typeCode);
    }

    @Override
    public AppInfo appInfoListShow(int id) throws Exception{
        AppInfo appInfo = null;
        appInfo = main.appInfoList(id);
        return appInfo;
    }

    @Override
    public List<AppInfo> appVersionListShow(int id) throws Exception {
        return main.appVersion(id);
    }

    @Override
    public AppVersion appVersionList_SH(int id) throws Exception {
        return main.appVersion_SH(id);
    }


}